package easy;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/27 15:44
 */
public class ApperanceOnceNum {
    private class Solution {
        public int singleNumber(int[] nums) {
            for (int i = 0; i < nums.length; i++) {
                boolean flag = true;
                for (int j = i + 1; j < nums.length; j++) {
                    if (nums[i] == nums[j]) {
                        flag = false;
                        break;
                    }
                }
                if (flag) {
                    return nums[i];
                }
            }

            return -1;
        }
    }
}
